from base.Base import Base
from time import sleep
from selenium.webdriver.common.by import By
import logging

class GuanZhuPage(Base):

    gaunzhu = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.ImageView')

    sandain = (By.ID,'com.kongfz.app:id/tv_navigation')

    shoucang = (By.XPATH,'//android.widget.TextView[@text="收藏"]')

    sandain2 = (By.ID, 'com.kongfz.app:id/tv_navigation')

    quxiao = 'new UiSelector().text("取消收藏")'

    sandian3 = (By.ID, 'com.kongfz.app:id/tv_navigation')

    dy = (By.XPATH,'//android.widget.TextView[@text="收藏"]')

    def guanzhuyewu(self):
        #代码步骤
        self.loc_ID(self.gaunzhu).click()
        sleep(3)
        self.loc_wait(self.sandain).click()
        sleep(3)
        self.loc_ID(self.shoucang).click()
        sleep(3)
        self.loc_ID(self.sandain2).click()
        sleep(3)
        self.loc_ui(self.quxiao).click()
        sleep(3)
        self.loc_ID(self.sandian3).click()
        sleep(3)
